package com.nine.result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author nine
 * @version 1.0
 * @description TODO
 * @date 2024-08-06 22:20
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class R {

	private int code;

	private String msg;

	private Object data;

	public static R ok() {
		return new R(200, "成功", null);
	}

	public static R ok(Object data) {
		return new R(200, "成功", data);
	}

	public static R error() {
		return new R(500, "失败", null);
	}

	public static R error(Object data) {
		return new R(500, "失败", data);
	}

}
